package com.mall.mymall.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mall.mymall.dao.dto.CommentsDto;
import com.mall.mymall.dao.entity.ProductComments;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 十里坡
 * @since 2025-04-01
 */
public interface ProductCommentsMapper extends BaseMapper<ProductComments> {

    IPage<CommentsDto> selectMyComments(IPage<CommentsDto> page, @Param("userId") Integer userId);

    IPage<CommentsDto> selectPendingComments(IPage<CommentsDto> page, @Param("userId") Integer userId);

    void changeStatus(@Param("commentId") Integer commentId);

    void removeComments(@Param("commentId") Integer commentId);

    void saveCommentsContent(@Param("commentContent") String commentContent,@Param("productId") Integer productId,@Param("rating") Integer rating,@Param("userId") Integer userId);

    void changeStatusByProductIdAndUserId(@Param("productId") Integer productId,@Param("userId") Integer userId);
}
